﻿<Page
    x:Class="ProfilePicture.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ProfilePicture"
    xmlns:facebookControls="using:Facebook.Client.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <!-- http://facebooksdk.net/docs/windows/controls/login-ui-control/ -->

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

        <!--user information-->
        <facebookControls:ProfilePicture 
                VerticalAlignment="Top" HorizontalAlignment="Right" Margin="20" Height="200" Width="200"
                ProfileId="{Binding CurrentSession.FacebookId, ElementName=loginButton}" />

        <!--ContentPanel - place additional content here-->
        <TextBlock FontSize="48" Margin="20"
                    HorizontalAlignment="Left" 
                    VerticalAlignment="Center" 
                    x:Name="ContentPanel"  
                    Visibility="Collapsed">
            <Run Text="Welcome, Mr. "/>
            <Run Text="{Binding ElementName=loginButton, Path=CurrentUser.LastName}" />
        </TextBlock>

        <!-- login control -->
        <facebookControls:LoginButton 
                x:Name="loginButton" Margin="20"
                VerticalAlignment="Bottom"
                HorizontalAlignment="Right" 
                ApplicationId="1440981512795974" 
                SessionStateChanged="OnSessionStateChanged" />
    </Grid>

</Page>
